﻿using MassTransit;

namespace HuaweiCloud.Dotnet.Samples.ESports.Main.Consumers
{
    public class PointsInfoConsumerDefinition : ConsumerDefinition<PointsInfoConsumer>
    {
        public PointsInfoConsumerDefinition()
        {
            EndpointName = "PointsInfoMain";
        }

        protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, 
            IConsumerConfigurator<PointsInfoConsumer> consumerConfigurator)
        {
            endpointConfigurator.UseDelayedRedelivery(r => r.Intervals(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(15), TimeSpan.FromMinutes(30)));
            endpointConfigurator.UseMessageRetry(r => r.Immediate(5));
        }
    }
}
